import pandas as pd

# import seaborn as sns
import numpy as np

a = np.array([ 64,85,42,106,0,42,106,212,128,212,42,21,0,21,21,0,255,0,0,21])
# a = np.array([255.0,255.0,255.0,255.0,153.0,102.0,255.0,204.0,51.0,51.0])
data2 = np.argsort(-a)
dataset = np.array(data2[:8], dtype=int)
c = bin(79)
# d =
c = ''.join(c[2:])
d = []
d.__iadd__(c)
d = np.array(d, dtype=int)
chooselist = np.zeros(8)
chooselist[8 - len(d):] = d
# datakey = np.array([4, 5, 9, 1, 3, 16, 0, 2],dtype=int)
datakey = dataset * chooselist
# [f1, f2, f4, f3, f10, f9, f8, f7, f5, f6, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20])
namelist = np.array(['最大值','最小值','四个相邻像素值之间的差值之和','四个相邻像素二阶差的绝对值之和。使用对角拉普拉斯滤波器计算二阶差分，',
                     '四个相邻像素右梯度之间差异的大小之和','四个相邻像素左梯度之间差异的大小之和','其相邻像素右侧梯度的大小之和','其相邻像素左侧梯度的大小之和',
                     '四个相邻像素值之间差异的方差','像素点和周边12个像素的的差值和','sobel mask','0，45，90，135度角','周边四个像素方差','以xn，m为中心的四个水平像素的局部方差计算','以xn，m为中心的四个竖直像素的局部方差计算',
                    '表示以xn，m为中心的5×5尺寸块的水平差和垂直差之和','12个点像素和其均值求差然后求和','45度梯度大小之和','135度梯度大小之和','由本地二进制模式（LBP）提取',])
namelist = namelist[data2]
namelist = namelist[:8]
datakey = np.array(datakey[datakey!=0],dtype=int)
namelist2 = namelist[datakey]
print(datakey)
# namelist = namelist[datakey]
# print(namelist)
